{!capture name='main'!}
<h1>登录</h1>
<form method="post" action="/action/actor_login" onsubmit="return onSubmit(this)">
<input type="hidden" name="rurl" value="{!$curUrl!}"/>
<table cellspacing="0" cellpadding="4" border="0" width="100%">
	<tr>
		<td width="60" class="r">Email：</td>
		<td>
			<input type="text" name="email" style="width:200px;" maxlength="20"  tabindex="1" id="txtEmail"/>
			<a href="/register" tabindex="6" title="点击注册">还没有注册？</a>
		</td>
	</tr>
	<tr>
		<td class="r">密  码：</td>
		<td>
			<input type="password" name="password" style="width:200px;" maxlength="20" tabindex="2"/>
			<a href="/findpwd" tabindex="7" title="点击找回密码">忘记密码？</a>
		</td>
	</tr>
	<tr>
		<td class="r">验证码：</td>
		<td>
			<input type="text" id="txtValidCode" name="validCode" style="width:100px;" maxlength="4" tabindex="3"/>
			<img style="width:56px;height:20px;display:none;" alt="验证码" id="imgValidCode" align="absmiddle"/>
			&nbsp;<a href="javascript:void(0);" id="lnkReload" style="display:none;" title="点击刷新图片">看不清？</a>
		</td>
	</tr>
	<tr><td></td><td>
		<input type="checkbox" id="persist"	name="persist" value="1"  tabindex="4"/><label for="persist">在这台电脑上记住我</label>
	</td></tr>
	<tr>
		<td></td>
		<td><input type="submit" value="登录" tabindex="5"/></td>
	</tr>
</table>
</form>
<br/>
<br/>
<br/>
<br/>
<a href="/register?rurl={!$curUrl!}">>> 我还没有注册</a>
{!/capture!}
{!capture name='jsCode'!}
<script type="text/javascript">
function onSubmit(form){
	if (!/^\w+([-+.']\w+)*@\w+([-.]\w+)*(\.\w+([-.]\w+)*)*$/.test(form.email.value)) {
		alert("Email格式不正确！");
		form.email.focus();
		return false;
	}
	if (!$.trim(form.password.value)) {
		alert("密码不能为空！");
		form.password.focus();
		return false;
	}
	if (!/[\da-zA-Z]{4}/.test($.trim(form.validCode.value))){
		alert("验证码必须为4位的数字或字母");
		form.validCode.focus();
		return false;
	}
	return true;
}
var _init = false;
$('#txtValidCode').focus(function(){
	if (!_init) {
		$('#imgValidCode').css('display','')
			.attr('src','/validcode?=t' + new Date().getTime());
		$('#lnkReload').css('display','').click(function(){
			loadImage('/validcode?t=' + new Date().getTime(),function(){
				$('#imgValidCode').attr('src',this.src);
			});
		});
		_init = true;
	}
});
function loadImage(url, callback) {
    var img = new Image();
    img.src = url;
   
    if (img.complete) {
        callback.call(img);
        return;
    }

    img.onload = function () {
        callback.call(img);
    };
};
$('#txtEmail').focus();
</script>
{!/capture!}

{!include file='layouts/default.tpl'!}